#include "thread_pool.hpp"
#include "task.hpp"
#include <ctime>
#include <unistd.h>

#define NUM 5

int main()
{
  srand((unsigned)time(nullptr));
  ThreadPool<Task> *tp = new ThreadPool<Task>(NUM);
  tp->InitThreadPool();
  
  const std::string ops = "+-*/%";
  while(true)
  {
    int x = rand() % 50 + 1;
    int y = rand() % 50 + 1;
    char op = ops[rand() % 5];

    Task t(x, y, op);
    tp->PushTask(t);
    sleep(1);
  }
  return 0;
}
